import pickle

device_message_list = {}
message_list = {}
user_message_list = []
massage = []
massage.append("user")
massage.append("你好呀")
user_message_list.append(massage)

massage = []
massage.append('assistant')
massage.append("在干嘛呢")
user_message_list.append(massage)

message_list.update({"爱你一万年":user_message_list})
message_list.update({"喜欢你":user_message_list})

device_message_list.update({"xiaomi11":message_list})

print(len(device_message_list))
print(device_message_list)

# 将对象序列化并保存到文件
# with open('device_message_list.pkl', 'wb') as file:
#     pickle.dump(device_message_list, file)
# print("对象已序列化并保存到 data.pkl")


# 从文件中读取并反序列化对象
with open('device_message_list.pkl', 'rb') as file:
    loaded_data = pickle.load(file)
print("对象已从 data.pkl 反序列化")
print(loaded_data)
